//
//  MyCollectionViewCell.m
//  Zaker
//
//  Created by dllo on 16/3/17.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.bigView = [[UIView alloc] init];
        [self.contentView addSubview:_bigView];
        
        self.title = [[BaseLabel alloc] init];
        [self.bigView addSubview:_title];
        _title.textAlignment = 1;
        
        self.ima = [[UIImageView alloc] init];
        [self.bigView addSubview:_ima];
        
        
//        _bigView.layer.borderColor = [UIColor redColor].CGColor;
//        _bigView.layer.borderWidth = 1;
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _bigView.frame = CGRectMake(1, 1, self.contentView.frame.size.width - 2, self.contentView.frame.size.height - 2);
    self.ima.frame = CGRectMake(0, 0, 35, 35);
    _ima.center = CGPointMake(self.contentView.center.x, self.contentView.center.y - 20);
    self.title.frame = CGRectMake(0, _ima.frame.origin.y + _ima.frame.size.height + 5, self.contentView.frame.size.width, 20);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
